package me.fanchaoo.web.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.fanchaoo.dbo.MiniAppConfigDBO;
import me.fanchaoo.dbo.WelcomeConfigDBO;
import me.fanchaoo.web.dto.*;
import me.fanchaoo.web.request.LoginRequest;
import me.fanchaoo.web.request.QuerySquareMomentRequest;
import me.fanchaoo.web.request.miniAppConfigRequest;
import me.fanchaoo.web.response.BaseResponse;
import me.fanchaoo.web.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

@Api(description = "配置")
@RestController
@RequestMapping("/miniAppConfig")
public class MiniConfigController {



    @Autowired
    private MiniAppConfigService miniAppConfigService;



    @ApiOperation(value = "查询小程序配置")
    @PostMapping(value = "/queryMiniAppConfig")
    public BaseResponse<MiniAppConfigDBO> queryMiniAppConfig(@Valid @RequestBody miniAppConfigRequest request) {
        return new BaseResponse<MiniAppConfigDBO>().setBody(miniAppConfigService.queryMiniAppConfig(request));
    }

    @ApiOperation(value = "查询小程序配置")
    @PostMapping(value = "/queryWelcomeConfig")
    public BaseResponse<WelcomeConfigDBO> queryWelcomeConfig(@Valid @RequestBody miniAppConfigRequest request) {
        return new BaseResponse<WelcomeConfigDBO>().setBody(miniAppConfigService.queryWelcomeConfig(request));
    }



}
